import numpy as np
import math
from PyCmpltrtok.common import sep
from PyCmpltrtok.common_3d import get_xyz, get_chunk

scale = 1.0
N = 3
t = np.linspace(0, 10*(N-1), N, dtype=np.float32)
X, Y, Z = np.meshgrid(t, t, t, sparse=True, indexing='ij')
print('X', X.shape)
print('Y', Y.shape)
print('Z', Z.shape)

for nx in range(N):
    for ny in range(N):
        for nz in range(N):
            print(nx, ny, nz, get_xyz(nx, ny, nz, X, Y, Z))

chunk_size = 4
n_chunks = int(math.ceil(N ** 3 / chunk_size))
for i in range(n_chunks):
    xchunk = get_chunk(i, chunk_size, X, Y, Z, N)
    sep(i)
    print(xchunk)
